package dk.javacode.srsm;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

import dk.javacode.srsm.converters.JdbcDataConverter;

public class ColumnDescriptor {
	private String columnName;
	private Field columnField;
	private Method columnSetMethod;

	private Field columnReference;
	private Method columnReferenceSetter;

	private JdbcDataConverter<?> dataConverter;

	private boolean nullable;
	private boolean primaryKey;

	public JdbcDataConverter<?> getDataConverter() {
		return dataConverter;
	}

	public void setDataConverter(JdbcDataConverter<?> dataConverter) {
		this.dataConverter = dataConverter;
	}

	public String getColumnName() {
		return columnName;
	}

	public void setColumnName(String columnName) {
		this.columnName = columnName;
	}

	public Field getColumnField() {
		return columnField;
	}

	public void setColumnField(Field columnField) {
		this.columnField = columnField;
	}

	public Method getColumnSetMethod() {
		return columnSetMethod;
	}

	public void setColumnSetMethod(Method columnSetMethod) {
		this.columnSetMethod = columnSetMethod;
	}

	public Field getColumnReference() {
		return columnReference;
	}

	public void setColumnReference(Field columnReference) {
		this.columnReference = columnReference;
	}

	public Method getColumnReferenceSetter() {
		return columnReferenceSetter;
	}

	public void setColumnReferenceSetter(Method columnReferenceSetter) {
		this.columnReferenceSetter = columnReferenceSetter;
	}

	public boolean isNullable() {
		return nullable;
	}

	public void setNullable(boolean nullable) {
		this.nullable = nullable;
	}

	public boolean isPrimaryKey() {
		return primaryKey;
	}

	public void setPrimaryKey(boolean primaryKey) {
		this.primaryKey = primaryKey;
	}

	@Override
	public String toString() {
		return "ColumnDescriptor [columnName=" + columnName + ", columnField=" + columnField + ", columnReference="
				+ columnReference + ", nullable=" + nullable + ", primaryKey=" + primaryKey + "]";
	}

}
